﻿using System;
using UnityEngine;

// Token: 0x020001C3 RID: 451
public class CutAct_Voice : CutAction
{
	// Token: 0x06000BAB RID: 2987 RVA: 0x00043F0C File Offset: 0x0004210C
	public CutAct_Voice(CutScene cutScene) : base(cutScene, CUTACT.VOICE)
	{
	}

	// Token: 0x06000BAC RID: 2988 RVA: 0x00043F18 File Offset: 0x00042118
	public CutAct_Voice(CutScene cutScene, float time, string chara, string voice) : base(cutScene, CUTACT.VOICE, time)
	{
		this.chara = chara;
		this.voice = voice;
	}

	// Token: 0x06000BAD RID: 2989 RVA: 0x00043F34 File Offset: 0x00042134
	public override object Clone()
	{
		return new CutAct_Voice(this.cutScene);
	}

	// Token: 0x06000BAE RID: 2990 RVA: 0x00043F44 File Offset: 0x00042144
	public override void Load(TagText.Element element, int order)
	{
		base.Load(element, order);
		element.GetVal(ref this.chara, "chara", 0);
		element.GetVal(ref this.voice, "voice", 0);
		element.GetVal(ref this.loop, "loop", 0);
	}

	// Token: 0x06000BAF RID: 2991 RVA: 0x00043F94 File Offset: 0x00042194
	public override void Save(TagText.Element element)
	{
		base.Save(element);
		element.AddAttribute("chara", this.chara);
		element.AddAttribute("voice", this.voice);
		if (this.loop)
		{
			element.AddAttribute("loop", this.loop.ToString());
		}
	}

	// Token: 0x06000BB0 RID: 2992 RVA: 0x00043FF4 File Offset: 0x000421F4
	public override void Action(bool skip)
	{
		if (this.voice.IsNullOrEmpty())
		{
			GlobalData.Debug_Log("没有指定声音文件名");
			return;
		}
		AudioClip clip = this.cutScene.LoadAsset<AudioClip>(this.voice);
		Human human = this.cutScene.GetHuman(this.chara);
		human.PhonationVoice(clip, this.loop);
	}

	// Token: 0x04000BD3 RID: 3027
	public string chara;

	// Token: 0x04000BD4 RID: 3028
	public string voice;

	// Token: 0x04000BD5 RID: 3029
	public bool loop;
}
